home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-tastal.adb < prev    next >
Text File  |  1996-01-30  |  3KB  |  73 lines

  1. -----------------------------------------------------------------------------
  2. --                                                                         --
  3. --                GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                         --
  5. --       S Y S T E M . T A S K _ S T O R A G E _ A L L O C A T I O N       --
  6. --                                                                         --
  7. --                                 B o d y                                 --
  8. --                                                                         --
  9. --                            $Revision: 1.5 $                             --
  10. --                                                                         --
  11. --       Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved        --
  12. --                                                                          --
  13. -- GNARL is free software; you can redistribute it  and/or modify it  under --
  14. -- terms  of  the  GNU  Library General Public License  as published by the --
  15. -- Free Software  Foundation;  either version 2, or (at  your  option)  any --
  16. -- later  version.  GNARL is distributed  in the hope that  it will be use- --
  17. -- ful, but but WITHOUT ANY WARRANTY;  without even the implied warranty of --
  18. -- MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. -- eral Library Public License  for more details.  You should have received --
  20. -- a  copy of the GNU Library General Public License along with GNARL;  see --
  21. -- file COPYING.LIB.  If not,  write to the  Free Software Foundation,  675 --
  22. -- Mass Ave, Cambridge, MA 02139, USA.                                      --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Storage_Elements;
  27. --  Used for, Storage_Count
  28.  
  29. with System.Task_Memory;
  30. --  Used for, Low_Level_New
  31. --            Low_Level_Free
  32.  
  33. package body System.Task_Storage_Allocation is
  34.  
  35.    --------------------
  36.    -- Allocate_Block --
  37.    --------------------
  38.  
  39.    --  Note: the Alignment parameter is ignored here, since Low_Level_New
  40.    --  is guaranteed to return a block of the maximum possible alignment.
  41.  
  42.    procedure Allocate_Block
  43.      (Storage_Address : out System.Address;
  44.       Storage_Size    : Storage_Elements.Storage_Count;
  45.       Alignment       : in Storage_Elements.Storage_Count)
  46.    is
  47.    begin
  48.       Storage_Address := Task_Memory.Low_Level_New (Storage_Size);
  49.    end Allocate_Block;
  50.  
  51.    ----------------------
  52.    -- Deallocate_Block --
  53.    ----------------------
  54.  
  55.    procedure Deallocate_Block (Storage_Address : System.Address) is
  56.    begin
  57.       Task_Memory.Low_Level_Free (Storage_Address);
  58.    end Deallocate_Block;
  59.  
  60.    ---------------------
  61.    -- Maximum_Storage --
  62.    ---------------------
  63.  
  64.    --  Returns zero, indicating no fixed limit, since there is no fixed
  65.    --  (determinable) limit on the memory available on a POSIX system.
  66.  
  67.    function Maximum_Storage return Storage_Elements.Storage_Count is
  68.    begin
  69.       return 0;
  70.    end Maximum_Storage;
  71.  
  72. end System.Task_Storage_Allocation;
  73.